package com.aaa.controller;

import com.aaa.entity.ContractLease;
import com.aaa.entity.Result;

import com.aaa.query.ContractQuery;
import com.aaa.service.IContractLeaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：李世磊
 * @date ：Created in 2021/1/27 15:50
 * @description： 其他资产租出合同控制器
 * @modified By：
 * @version: 1.0
 */
@RestController
@RequestMapping("/leaseElse")
public class ContractLeaseElseController {

    @Autowired
    IContractLeaseService service;


    /**
     * 其他资产租出合同 查询所有
     */

    @RequestMapping("/listAllElse")
    public Result listAllElse(){

        return service.listAllElse();
    }

    /**
     *  其他资产租出合同 添加合同
     * @param contract
     */

    @RequestMapping("/add")
    public Result addLeaseElse(@RequestBody ContractLease contract){

        return service.addLeaseElse(contract);
    }

    /**
     *  其他资产租出合同 修改合同
     * @param contract
     */

    @RequestMapping("/update")
    public Result updateLeaseElse(@RequestBody ContractLease contract){

        return service.updateLease(contract);
    }

    /**
     *  其他资产租出合同 分页+模糊查询
     * @param  query
     * @return
     */

    @PostMapping("/query")
    public Result LeaseElseQuery(@RequestBody ContractQuery query){

        return service.LeaseElseQuery(query);

    }






}
